#include<iostream>
#include<vector>
#include<string>
using std::vector;
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
	vector<int> num(10);
	for (auto&c : num)
		cin >> c;
	for (size_t i = 0; i < num.size(); i+=2){
		cout << num[i] + num[i + 1] << ' ';
	}
	cout << endl;
	for (size_t i = 0; i < num.size()/2; i++){
		cout << num[i] + num[num.size() - i-1] << ' ';
	}
	system("pause");
	return 0;
}